function MockConnector(mocks) {
    this.onerror = signal();
    this.$.mocks = mocks;
}

function emit(klass, method, callback, args) {

    var id = window.setTimeout(function() {
        
       callback(this.$.mocks[method](args));
        
    }.bind(this), 500);
    
    return function() {
        try {
            window.clearTimeout(id);
        } catch(ex) {
        }
    };
}